  var setting = {
      data: {
          simpleData: {
              enable: true
          }
      },
      //回调
      callback: {
          onClick: zTreeOnClick
      },
      view: {
          fontCss: { fontSize: "14px" }
      }
  };
  //节点点击事件
  function zTreeOnClick(event, treeId, treeNode) {
      $('#orgName').val(treeNode.name);
      $("#parentId").val(treeNode.id);
      hideTree();  
  };
//下拉框显示 隐藏
 function showTree(){
    if($('.ztree').css('display') == 'none'){
         $('.ztree').css('display','block'); 
     } else{
         $('.ztree').css('display','none'); 
     }
    $("body").bind("mousedown", onBodyDownByActionType); 
 }
 function hideTree() {  
    $('.ztree').css('display','none');
    $("body").unbind("mousedown", onBodyDownByActionType); 
    return false;
} 

//区域外点击事件
function onBodyDownByActionType(event) {  
    if (event.target.id.indexOf('treeDemo') == -1){  
        if(event.target.id != 'selectDevType'){
            hideTree(); 
        } 
    }  
}